﻿@model PhoneStoreWeb.Models.LogInModel

@{
    ViewBag.Title = "LogIn";
    Layout = null;
}

@if (!Request.IsAuthenticated)
{
    <div id="login">
        @{
            using (@Html.BeginForm("LogIn", "Account", FormMethod.Post, new { @autocomplete = "off" }))
            {
                <strong>ĐĂNG NHẬP</strong>
                <br />
                @Html.TextBoxFor(m => m.UserName, new { @class = "username", @placeholder = "Tên đăng nhập" })
                @Html.PasswordFor(m => m.Password, new { @class = "password", @placeholder = HttpUtility.HtmlDecode("&#9679;&#9679;&#9679;&#9679;&#9679;&#9679;&#9679;&#9679;") })
                <br />
                @Html.CheckBoxFor(m => m.RememberMe, new { @class = "remember" })
                @Html.LabelFor(m => m.RememberMe, new { @class = "remember" })
                <input type="submit" name="submit" class="login-button" value="Đăng nhập" />
            }
        }
        <div class="register">
            <a href="~/Account/Register">Đăng ký</a>                
            <strong> | </strong>
            <a href="~/Account/ForgotPassword">Quên mật khẩu?</a>
        </div>
    </div>
}
else
{
    <div id="logout">
        <div>Xin chào <b>@Html.Encode(User.Identity.Name)</b></div>
        <div id="buttons">
            <a href="~/Account/ChangePassword">Đổi mật khẩu</a>
            @Html.ActionLink("Đăng xuất", "LogOut", "Account", new { }, new { @class = "logout-button" })
        </div>
    </div>
}